package com.woniu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.controller.form.OrderVo;
import com.woniu.dao.BmsUserMapper;
import com.woniu.dao.MembersMapper;
import com.woniu.dao.OrderMapper;
import com.woniu.model.Order;
import com.woniu.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Kevin Kwok
 * @create 2021-04-15 18:55
 */
@Service
@Slf4j
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService {
    @Resource
    private OrderMapper mapper;
    @Resource
    private BmsUserMapper bmsUserMapper;
    @Resource
    private MembersMapper membersMapper;


    /**
     * 前端获取待付款的全部订单
     * @return
     */
    @Override
    public List<OrderVo> getOrders(Integer status) {
        //临时数据
        Integer uid = 1;

        List<OrderVo> orders = mapper.getOrders(uid, status);
        return orders;
    }

    @Override
    public List<OrderVo> getAllOrders() {
        //临时数据
        Integer uid = 1;

        List<OrderVo> orders = mapper.getAllOrders(uid);
        return orders;
    }
    /**
     * 订单支付时间倒计时（订单创建时执行，支付成功后关闭）
     *
     */



}
